package view {
    import mx.containers.Canvas;

    public class ScoreEggList extends Canvas {
        public function set scoreRules(rules:Array):void {
            this.removeAllChildren();
            if (rules.length <= 0) return;
            for (var i:int=0; i < rules.length; i++) {
                var scoreEgg:ScoreEgg = new ScoreEgg();
                scoreEgg.x = this.width * i / rules.length;
                scoreEgg.name = String(i + 1);
                if (i > 0) {
                    scoreEgg.preLevelScore = rules[i-1];
                } else {
                    scoreEgg.preLevelScore = 0;
                }
                scoreEgg.levelScore = rules[i];
                this.addChild(scoreEgg);
            }
        }
    }
}
